﻿@using Orchard.Comments.Models
@using Orchard.ContentManagement

@{
    CommentPart comment = Model.ContentPart;
    CommentsPart comments = comment.CommentedOnContentItem.As<CommentsPart>();

    var children = New.List(Items: Model.Items);
    children.Classes.Add("comments");
}

<div class="media">
    <article class="comment comment-@comment.Id">
        <a href="#" class="pull-left comment-avatar">
            @Display.CommentGravatar(ContentPart: comment)
        </a>
        <div class="media-body">
            <header>
                <h5 class="media-heading">
                    <span class="who">@Display.CommentAuthor(ContentPart: comment)</span>
                    <span class="when">@Display.CommentMetadata(ContentPart: comment)</span>
                    @if (comments.ThreadedComments) {
                        <span class="reply">@Display.CommentReplyButton(ContentPart: comment)</span>
                    }
                </h5>
            </header>

            @Display.CommentText(ContentPart: Model.ContentPart, ContentItem: Model.ContentItem)

            @Display(children)
        </div>
    </article>
</div>